package com.practise.coffee.dao;

import com.practise.coffee.entity.coffee.TargetCoffee;
import com.practise.coffee.entity.other.ExtentMaterial;
import com.practise.coffee.entity.other.Milk;
import com.practise.coffee.entity.other.Suger;
import com.practise.coffee.enums.CoffeeType;

/**
 * 卡布奇诺咖啡制作
 *
 * @author:lhz
 * @date:2019/2/18 10:03
 */
public class CappuccinoMakeDaoImpl implements MakeDao {
	@Override
	public CoffeeType type() {
		return CoffeeType.CAPPUCCINO;
	}

	@Override
	public void pouringCoffeePowder() {
		System.out.println("add Cappuccino");
	}

	@Override
	public void pouringWater(int degree) {
		System.out.println("add water degree"+ degree);
	}

	@Override
	public void stiring() {
	}

	@Override
	public void freeze() {
	}

	@Override
	public void flushFlower() {
	}

	@Override
	public <T extends ExtentMaterial> void addMaterial(T t) {
		if (t instanceof Suger) {
			System.out.println("Suger");
		}
		if (t instanceof Milk) {
			System.out.println("Milk");
		}
	}

	@Override
	public TargetCoffee makeSuccess() {
		TargetCoffee tc = new TargetCoffee();
		tc.setCoffeeType(CoffeeType.CAPPUCCINO);
		tc.setCreatTime(System.currentTimeMillis());
		tc.setPrice(10.);
		tc.setName("不卡起落");
		return tc;
	}

	@Override
	public void sell() {
	}
}
